﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<UI.Models.ListProductByCategory>" %>
<%@ Import Namespace="UI.Helper" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <%= Utils.IncludeJS(this.Html, "~/Scripts/js/prototype.js")%>
    <%= Utils.IncludeJS(this.Html, "~/Scripts/js/scriptaculous.js?load=effects,builder")%>
    <%= Utils.IncludeJS(this.Html, "~/Scripts/js/lightbox.js")%>
    
        <td width="73%" valign="top"><div id="gallery">
        <table width="100%" cellspacing="0" cellpadding="0">
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td align="center" valign="middle" class="Backround-black-01"><table width="100%" cellspacing="3" cellpadding="3">
                  
                  <tr>
                    <td valign="top"><table width="100%" cellspacing="0" cellpadding="0">
                      <tr>
                        <td  height="246" align="left" valign="top"><table width="100%" cellspacing="2" cellpadding="2">
                          <tr>
                            <td height="38" valign="top"><table style="border-bottom:1px dotted #999999;" width="100%" cellspacing="0" cellpadding="0">
                              <tr>
                                <td height="35" class="Title-yellow"><%: Model.Name %></td>
                              </tr>
                            </table></td>
                          </tr>
                          <%  
                                    for (var i = 0; i< Model.liProductModel.Count();i+=0)
                                {
                                        
                                    int j = 0;
                                %>
                          <tr>
                            <td height="209" >
                            <table width="100%" cellspacing="0" cellpadding="0">
                              <tr>
                              <%  
                                    for (j=0 ; j < 4; j++)
                                    {
                                        
                                        if (i < Model.liProductModel.Count()){
                                %>
                                <td><table width="100%" cellpadding="2" cellspacing="3">
                                  <tr>
                                    <td height="166">
                                    <a href="<%= Url.Content(Model.liProductModel[i].Url)%>" >
                                    <img src="<%= Url.Content(Model.liProductModel[i].Url)%>" width="155" height="155" /></a>
                                    </td>
                                  </tr>
                                  <tr>
                                    <td class="Title-white">Mã : <%= Model.liProductModel[i].Name%><br /></td>
                                  </tr>
                                </table></td>
                                <% i ++; }} %>  
                              </tr>
                            </table>
                            </td>
                          </tr>
                          <% } %>

                        </table></td>
                        </tr>
                    </table></td>
                  </tr>
                  
                </table></td>
              </tr>
              
              <tr>
                <td align="left" valign="middle">&nbsp;</td>
              </tr>
              <tr>
            <td style="float:right" >
                <!--  start paging..................................................... -->
                <% if (Model.liProductModel.Count() > 0)
                   {
                       
                %>
			    <table border="0" cellpadding="0" cellspacing="0" id="paging-table">
			    <tr>
			    <td>
                    <%: Html.ActionLink(" ", "Category", new { controller = "Product", page = 1, id = Model.CategoryId }, new { @class = "page-far-left" })%>
                    <%: Html.ActionLink(" ", "Category", new { controller = "Product", page = ((int)ViewData[Constants.PAGE_INDEX] - 1) < 1 ? 1 : ((int)ViewData[Constants.PAGE_INDEX] - 1), id = Model.CategoryId }, new { @class = "page-left" })%>
				    <div id="page-info">Page <strong><%: ViewData[Constants.PAGE_INDEX]%></strong> / <%: ViewData[Constants.TOTAL_PAGE]%></div>
                    <%: Html.ActionLink(" ", "Category", new { controller = "Product", page = ((int)ViewData[Constants.PAGE_INDEX] + 1) > (int)ViewData[Constants.TOTAL_PAGE] ? ViewData[Constants.TOTAL_PAGE] : ((int)ViewData[Constants.PAGE_INDEX] + 1), id = Model.CategoryId }, new { @class = "page-right" })%>
                    <%: Html.ActionLink(" ", "Category", new { controller = "Product", page = ViewData[Constants.TOTAL_PAGE], id = Model.CategoryId }, new { @class = "page-far-right" })%>
			    </td>
			    </tr>
			    </table>
                <% } %>
			    <!--  end paging................ -->
            </td>
        </tr>
            </table>
            </div>
            </td>
            
</asp:Content>
